package win.zxshuo.www.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import win.zxshuo.www.model.CategoryModel;

import java.util.List;

@Repository
public interface CategoryRepository extends JpaRepository<CategoryModel,Long> {

    @Query(value = "SELECT NAME  FROM category",nativeQuery = true)
    public List<String> getAllCategoryNames();

    public CategoryModel getByName(String name);

}
